package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        int a , b;
        Scanner scanner =new Scanner(System.in);
        a= scanner.nextInt();
        b= scanner.nextInt();
        List<Boolean> list=new ArrayList<Boolean>(a);
        for (int i=0;i<a;i++){
            list.add(true);
        }

        for (int j=1;j<b;j++){
            for (int i=0;i<list.size();i++){
                if ((i+1)%(j+1)==0) list.set(i,!list.get(i));
            }
        }
        for (int i=0;i<list.size();i++){
            if((boolean)list.get(i)){
                System.out.print((i+1)+"\t");
            }
        }
    }
}
